package com.luculent.util.extension;

import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.introspect.JacksonAnnotationIntrospector;
import com.luculent.util.extension.datamasking.annotation.Sensitive;

import java.lang.annotation.Annotation;

/**
 * @author zhangyang
 * @Date 2021/11/16 14:57
 */
public class JacksonSensitiveAnnotationIntrospector extends JacksonAnnotationIntrospector {
    /**
     * Annotations with meta-annotation {@link JacksonAnnotationsInside}
     * are considered bundles.
     *
     * @param ann
     */
    @Override
    public boolean isAnnotationBundle(Annotation ann) {
        if(ann.annotationType() == Sensitive.class){
            return false;
        }
        return super.isAnnotationBundle(ann);
    }
}
